// types/modal.ts
export interface ModalButton {
  text: string
  type?: 'primary' | 'default' | 'danger'
  onClick?: () => void | Promise<void>
  autoClose?: boolean
  loading?: boolean
}

export interface ModalConfig {
  title?: string
  content?: string
  contentComponent?: any
  componentProps?: Record<string, any>
  width?: string | number
  closable?: boolean
  maskClosable?: boolean
  showHeader?: boolean
  showFooter?: boolean
  buttons?: ModalButton[]
  onClose?: () => void
  onOpen?: () => void
}

// 全局状态接口
export interface ModalState {
  visible: boolean
  config: ModalConfig
}
